/* eslint-disable no-multiple-empty-lines */
<template>
  <div>
    <Authc permissions="trade:settlement:cmb">
      <div>
        <a style="margin: 0 4px;" @click="handleDetail('abnormal')" v-if="isShowBtn">异常明细</a>
        <a @click="handleDetail('detail')">清分明细</a>
      </div>
    </Authc>
  </div>
</template>
<script>
  import {
    Icon,
    Tooltip,
    Message,
    Modal
  } from "view-design";
  // import {
  //   namespace
  // } from "../../module/blanketModule";
  import Authc from "@/components/Authc";

  export default {
    props: {
      row: Object,
      isShowBtn: Boolean
    },
    model: {
      event: ["onEdit"]
    },
    components: {
      Icon,
      Tooltip,
      Message,
      Authc
    },
    data: function() {
      return {
        // isShowBtn: true
      };
    },
    created () {
      //  if (this.$props.row.diffSubOrderCount == '0' || (this.$props.row.diffSubOrderCount == this.$props.row.diffOrderCount)) {
      //   this.isShowBtn = false;
      // }
    },
    methods: {
      handleDetail(type) {
        let subMchId = this.$props.row.subMchId; /** 商户号 **/
        let clearDate = this.$props.row.clearDate; /** 清分日期 **/
        let costType = this.$props.row.costType; /** 费用类型 */
        switch (type) {
          case 'detail':
            this.$bus.$emit('goDetailAcc', {
                subMchId: subMchId,
                clearDate: clearDate,
                costType: costType,
                typeStatus: true
            });
            break
          case 'abnormal':
            this.$router.push({
                path: 'clearingAbnormal',
                query: {
                    subMchId: subMchId,
                    clearDate: clearDate,
                }
            });
            break
          default:
        }
      }}
  };
</script>
<style lang="less">
  .normal-icon-style {
    font-size: 20px !important;
    color: #57a3f3 !important;
  }

  .error-icon-style {
    font-size: 20px !important;
    color: #ff0000 !important;
  }
</style>
